package innerClass.staticInnerClass;

public class staticInnerClassTest {
    public static void main(String[] args) {
        Outer outer = new Outer();
        outer.hi();
    }
}

class Outer {
    private int n1 = 10;
    private static String name = "张三";
    //静态内部类
    //放在外部类的成员位置
    //使用static修饰
    static class Inner {
        public void say() {
//            System.out.println(n1);  会报错
            System.out.println(name);
        }
    }

    public void hi() {
        Inner inner = new Inner();
        inner.say();
    }
}
